#!/bin/sh
#
# @name Intel Aero Ready to Fly Drone
#
# @type Quadrotor x
# @class Copter
#
# @maintainer Beat Kueng <beat@px4.io>
#
# @board px4_fmu-v2 exclude
# @board px4_fmu-v3 exclude
# @board px4_fmu-v4 exclude
# @board px4_fmu-v4pro exclude
# @board px4_fmu-v5 exclude
# @board px4_fmu-v5x exclude
# @board bitcraze_crazyflie exclude
#

. ${R}etc/init.d/rc.mc_defaults

#
# Load default params for this platform
#

# Set all params here, then disable autoconfig
param set-default EKF2_GPS_POS_X -0.06
param set-default EKF2_GPS_POS_Z -0.1
param set-default EKF2_MIN_OBS_DT 50

param set-default EKF2_BARO_GATE 10
param set-default EKF2_BARO_NOISE 5
param set-default EKF2_ACC_NOISE 0.7

param set-default LNDMC_Z_VEL_MAX 2

param set-default MC_ROLL_P 8
param set-default MC_ROLLRATE_P 0.13
param set-default MC_ROLLRATE_I 0.07
param set-default MC_ROLLRATE_D 0.0012
param set-default MC_ROLLRATE_MAX 360
param set-default MC_PITCH_P 8
param set-default MC_PITCHRATE_P 0.13
param set-default MC_PITCHRATE_I 0.07
param set-default MC_PITCHRATE_D 0.0012
param set-default MC_PITCHRATE_MAX 360
param set-default MC_YAW_P 4
param set-default MC_YAWRATE_P 0.12
param set-default MC_YAWRATE_I 0.05
param set-default MC_YAWRATE_D 0

param set-default MPC_LAND_SPEED 0.7
param set-default MPC_MANTHR_MIN 0.04
param set-default MPC_THR_HOVER 0.5
param set-default MPC_THR_MAX 0.94
param set-default MPC_THR_MIN 0.1
param set-default MPC_XY_CRUISE 8
param set-default MPC_XY_P 1.5
param set-default MPC_XY_VEL_P_ACC 3
param set-default MPC_Z_P 1.5
param set-default MPC_Z_VEL_P_ACC 16
param set-default MPC_Z_VEL_I_ACC 3
param set-default MPC_Z_VEL_MAX_DN 4
param set-default MPC_Z_VEL_MAX_UP 5

# TELEM2 config
param set-default MAV_1_CONFIG 102
param set-default MAV_1_RATE 80000
param set-default MAV_1_FORWARD 1
param set-default SER_TEL2_BAUD 921600

if ! param greater SYS_HITL 0
then
	tap_esc start -d /dev/ttyS0 -n 4
	usleep 300000

	set OUTPUT_MODE tap_esc
fi

set MIXER quad_x
set USE_IO no

